package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.ForumSorterReplyService;
import com.ai.web.vo.ForumSorterReplyV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.ForumSorterReply;
import com.tiny.persistence.repository.ForumSorterReplyRepo;

@Service
public class ForumSorterReplyServiceImpl extends BaseServiceImpl<ForumSorterReply, Integer, ForumSorterReplyV> implements ForumSorterReplyService  {

    @Autowired
    private ForumSorterReplyRepo forumSorterReplyRepo;
    
    @Autowired
    public ForumSorterReplyServiceImpl(ForumSorterReplyRepo forumSorterReplyRepo) {
        super(forumSorterReplyRepo);
    }

    public ForumSorterReplyV getForumSorterReply(int userId) throws Exception {
        return getT(userId);
    }

    public ResultModel saveForumSorterReply(ForumSorterReplyV forumSorterReplyV) throws Exception {
        
        ForumSorterReplyV saveV = saveT(forumSorterReplyV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteForumSorterReplys(List<Integer> userIds) throws Exception {
        deleteTs(userIds);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

}
